<!DOCTYPE HTML>
<html>

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="Bookmark" href="/favicon.ico">
  <link rel="Shortcut Icon" href="/favicon.ico" />
  <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
  <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
  <link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.css" />
  <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
  <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
  <!-- <script src="../ckeditor/ckeditor/ckeditor.js"></script> -->
  <link rel="stylesheet" type="text/css" href="/css/base.css">
  <link rel="stylesheet" type="text/css" href="/css/contract_manage.css">
  <title>合同管理</title>
</head>

<body>

  <include file="header" />
  <include file="aside" />



  <div class="page-container contract_manage Hui-article-box">

    <div class="text-c box_a">
      <div>
        日期范围：
        <input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate"
               style="width:150px;"> -
        <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',maxDate:'%y-%M-%d' })" id="logmax" class="input-text Wdate"
               style="width:150px;">
        <button name="" id="" class="btn btn-success" type="submit">
          <i class="Hui-iconfont">&#xe665;</i>查询
        </button>
      </div>
      <div>
        状态：
        <select class="select" name="brandclass" size="1" style="width:75px;height: 31px;position: relative;top: 2px;">
          <option value="0" selected>开启</option>
          <option value="1">关闭</option>
        </select>
        <input type="text" name="" id="" placeholder="请输入文字" style="width:150px" class="input-text">
        <button name="" id="" class="btn btn-success" type="submit">
          <i class="Hui-iconfont">&#xe665;</i> 搜索</button>
      </div>
    </div>



    <div class="tit common_tit">
      <span>合同管理</span>
      <!--<button class="btn btn-success radius ml-20" onClick="contract_add('合同编辑','contract_add.html','11')">-->
      <button class="btn btn-success radius ml-20" onClick="add_contract()">
            <i class="Hui-iconfont">&#xe600;</i>新建合同
        </button>
    </div>
    <div class="contrant_manage_table mt-20">
      <table class="table table-border table-bordered table-bg table-hover table-sort auth_table">
        <thead>
          <tr class="text-c">
            <th>序号</th>
            <td>添加时间</td>
            <th>合同标题</th>
            <!--<th>印章</th>-->
            <th>操作</th>
            <th class="del"></th>
          </tr>
        </thead>
        <if condition="!empty( $data )">
          <volist name="data" id="list" key="k">
            <tbody>
              <tr class="text-c">
                <td>{$k}</td>
                <td>2018.04.05 18:01:02</td>
                <td>{$list.name}</td>
                <!--<td>{$list.sealName }</td>-->
                <td>
                  <a href="javascript:;" style="text-decoration: none;">
                                <button class="buta" onClick="preview_contract('{$list.id}')">
                                    <i class="Hui-iconfont">&#xe725;</i>预览
                                </button>
                            </a>
                  <a href="javascript:;" style="text-decoration: none;">
                    <!--<button class="buta" onClick="contract_add('合同编辑','contract_add.html','11')"  >-->
                    <button class="buta" onClick="add_contract('{$list.id}')">
                                    <i class="Hui-iconfont">&#xe6df;</i>编辑
                                </button>
                  </a>
                </td>
                <td class="del">
                  <i class="Hui-iconfont delete" onClick="deleteInfos(this,'{$list.id}')">&#xe6a6;</i>
                </td>
              </tr>
            </tbody>
          </volist>
          <else/>
          <tbody>
            <tr class="text-c">
              <td colspan="5">暂时无数据</td>
            </tr>
          </tbody>
        </if>

      </table>
      <!--<div class="page-wrap dataTables_wrapper">-->
      <!--<div class="dataTables_info" id="DataTables_Table_0_info" role="status" aria-live="polite">显示 1 到 1 ，共 1 条</div>-->
      <!--<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">-->
      <!--<a class="paginate_button previous disabled" aria-controls="DataTables_Table_0" data-dt-idx="0" tabindex="0" id="DataTables_Table_0_previous">上一页</a>-->
      <!--<span>-->
      <!--<a class="paginate_button current" aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0">1</a>-->
      <!--</span>-->
      <!--<a class="paginate_button next disabled" aria-controls="DataTables_Table_0" data-dt-idx="2" tabindex="0" id="DataTables_Table_0_next">下一页</a>-->
      <!--</div>-->
      <!--</div>-->
      {$page}




    </div>
  </div>


</body>

</html>

  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/2.4/layer.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui/js/H-ui.min.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/static/h-ui.admin/js/H-ui.admin.js"></script>


  <script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
  <script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>





<script type="text/javascript">
    $(function() {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        $("#tab-system").Huitab({
            index: 0
        });
    });


    /*合同-添加*/
    function contract_add(title, url, id, w, h) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /**
     * 删除
     */
    function deleteInfos(obj, id) {
        var id = id;
        var objParent = $(obj).parents('tr')
        //询问框
        layer.confirm('温馨提示？', {
            btn: ['确定', '取消'], //按钮
            shade: false //显示遮罩
        }, function() {

            $.ajax({
                type: "post",
                url: "{:U('Admin/contractDel')}",
                data: {
                    "id": id
                },
                success: function(result) {
                    if (result == 10) {
                        layer.msg('操作成功', {
                            icon: 1
                        });
                        window.location.reload()
                    } else {
                        layer.open({
                            content: '操作失败',
                            time: 2
                        });
                        return false;

                    }
                }
            })



            objParent.remove()
        }, function() {
            layer.close()
        });
    }


    //新建、编辑合同
    function add_contract(id) {
        var id = id;
        if (id) {
            window.location.href = 'http://' + window.location.host + '/Admin/Admin/contractAdd/id/' + id + '/action/step1.html';
        } else {
            window.location.href = 'http://' + window.location.host + '/Admin/Admin/contractAdd/action/step1.html';

        }
    }


    //预览合同
    function preview_contract(id) {
        var id = id;
        window.location.href = 'http://' + window.location.host + '/Admin/Admin/previewContract/id/' + id + '.html';

    }
</script>
